<%--
  Created by IntelliJ IDEA.
  User: LEI
  Date: 2018/5/8
  Time: 20:34
  To change this template use File | Settings | File Templates.
--%>

<%@page import="java.util.List"%>
<%@page import="java.io.*" %>
<%@page import="javax.servlet.RequestDispatcher" %>
<%@page import="javax.servlet.annotation.WebServlet" %>
<%@page import="java.util.ArrayList" %>
<%@page import="java.util.Collections" %>
<%@page import="java.util.Iterator" %>
<%@page import="SearchList.SearchList" %>
<%@page import="java.io.IOException" %>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="bootstrap-3.3.7/docs/favicon.ico">

    <title>Sticky Footer Template for Bootstrap</title>

    <!-- Bootstrap core CSS -->
    <link href="bootstrap-3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">

    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <link href="bootstrap-3.3.7/docs/assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="sticky-footer.css" rel="stylesheet">

    <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
    <!--[if lt IE 9]><script src="bootstrap-3.3.7/docs/assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
    <script src="bootstrap-3.3.7/docs/assets/js/ie-emulation-modes-warning.js"></script>

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>

<!-- Begin page content -->
<div class="container">
    <div class="page-header">
        <h1>Demgle</h1>
    </div>

    <div class="row">
        <div class="col-lg-6">
            <form action="Servlet" method="post">
                <div class="input-group">
                    <input type="text" class="form-control" id="word" name="word" placeholder="Hadoop is so difficult">
                    <span class="input-group-btn">
                        <button class="btn btn-default" type="submit">Go!</button>
                    </span>
                </div><!-- /input-group -->
                <div class="radio">
                    <label>
                        <input type="radio" name="radio" id="radio2" value="Accurate"checked>
                        Accurate
                    </label>
                </div>
                <div class="radio">
                    <label>
                        <input type="radio" name="radio" id="radio1" value="Like">
                        Like
                    </label>
                </div>
            </form>
        </div><!-- /.col-lg-6 -->
    </div><!-- /.row -->
    <%--<table class="table table-bordered table-hover">
        <form action="Change" method="post">
            <h1>Result:</h1>
            <thead>
            <tr>
                <th>Name</th>
                <th>Email</th>
            </tr>
            </thead>--%>
            <%
                Object obj = request.getAttribute("search");  	//get the request and get the attribute and store in obj class
                List<SearchList> searchLists = null;
                if(obj instanceof List){
                    searchLists = (List<SearchList>)obj;  		//force the obj to List<User>
                }
                if(searchLists!=null){
                    for(SearchList user:searchLists){
                        
            %>

    <h2 style="color: #CC0000"><%= user.getWord() %></h2>

    <p> Address : <%= user.getAddress() %></p>
        <%
        for(int i=0;i<user.getLine().size();i++)
        {
        %>
            </br>
            <p  style="background-color: #c8e5bc"><b> Content : <%= user.getContent().get(i) %></b></p>
            <p> Line : <%= user.getLine().get(i) %> </p>
        <%
        }
        %>

    <%
            }
        }
    %>

</div>


<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="bootstrap-3.3.7/docs/assets/js/ie10-viewport-bug-workaround.js"></script>
</body>

</html>
